<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

$admin = array(
    'prefix'=>'center',
    'namespace'=>'Admin',
    'middleware'=>['web','access','AdminCheckLogin']
);
    Route::get('center/login', 'Admin\LoginController@getLogin');
    Route::get('center/register', 'Admin\LoginController@getRegister');
    Route::post('center/register', 'Admin\LoginController@postRegister');

//验证码
    Route::get('center/code', 'Admin\LoginController@getCode');
    Route::post('logindo','Admin\LoginController@postLogin');
    Route::get('logOut','Admin\LoginController@getLogOut');


    Route::group($admin, function(){
    Route::get('/', 'IndexController@getIndex');
    //意见反馈
    Route::get('feedback', 'FeedbackController@getIndex');
    Route::post('feedback/add', 'FeedbackController@postAdd');
    Route::post('feedback/del', 'FeedbackController@postDel');   //删除意见反馈

    //公告
    Route::get('announce', 'AnnounceController@getIndex');      //总后台公告管理
    Route::post('announce/add', 'AnnounceController@postAdd');
    Route::post('announce/del', 'AnnounceController@postZongAnnounceDel');   //删除总后台公告

    //品牌
    Route::get('brand', 'BrandController@getIndex');            //品牌列表显示
    Route::get('brand/apply', 'BrandController@getApply');      //审核管理
    Route::post('brand/verify', 'BrandController@postVerify');
    Route::get('brand/info', 'BrandController@getBrandInfo');
    Route::get('brand/agent', 'BrandController@getBrandAgentList');   //代理成员
    Route::post('brand/edit', 'BrandController@postEditInfo');
    Route::get('brand/order','OrderController@getOrderCount');
    Route::get('brand/add','BrandController@getAdd');           //添加品牌表单
    Route::post('brand/addok','BrandController@postAdd');       //添加品牌表单提交
    //品牌管理详情
    Route::get('brand/agent/info',"IndexController@getAgentInfo");
    Route::get('brand/agent/last_agent','IndexController@getLastAgent');
    Route::get('brand/modify-pwd','BrandController@getModifyPwd'); //修改密码
    Route::post('brand/modify-pwd','BrandController@postModifyPwd'); //修改密码

    //商品
    Route::get('goods', 'GoodsController@getIndex');     //商品管理
    Route::get('goods/add/view', 'GoodsController@getAddView');
    Route::get('goods/add/view/step2', 'GoodsController@getAddViewStep');
    Route::get('goods/category','GoodsController@getCategory');
    Route::get('goods/del','GoodsController@getDel');
    Route::post('goods/delall','GoodsController@postDel');
    Route::post('goods/add',"GoodsController@postAdd");
    //Route::get('goods/edit',"GoodsController@postEdit");
    Route::get('goods/edit',"GoodsController@getEdit");
    Route::post('goods/save',"GoodsController@postEditSave");

    //Route::
    Route::get('brand/apply', 'BrandController@getApply');          //审核管理
    Route::post('brand/verify', 'BrandController@postVerify');      //审核品牌

    Route::get('brand/del', 'BrandController@getDel');          //ajax删除品牌代理

    // 上传代理证书
    Route::post('agent/upload','IndexController@postAgentUpload');


    //
    Route::get('admin',"IndexController@getAdminInfo");
    Route::get('getimage','IndexController@getImageSoucer');    //品牌代理书显示
    Route::get('getmoban','IndexController@getImageMoban');    //样板显示
    Route::get('getimage/down','IndexController@getDownImage');
    Route::post('getimage/upload','IndexController@postSaveUpload'); //品牌代理书上传
    Route::post('getmoban/upload','IndexController@postSaveUpload2'); //样板上传
    Route::get('getaddress','IndexController@getAddress');

    // 代理层级列表信息
    Route::get('agentlev','IndexController@getIndex');

    // 代理层级添加
    Route::post('agentlev/add','IndexController@postAddAgentLev');
    //代理层级删除
    Route::post('agentlev/del','IndexController@postDelAgentLev');

    // 代理层级
    Route::get('agentlev/lev','IndexController@getLev');

    Route::get('agentlev/edit','IndexController@getEdit');
    //编辑代理
    Route::post('agentlev/save','IndexController@postSaveAgent');

    // 代理员列表
    Route::get('agent',"IndexController@getAgent");              //代理成员管理
    Route::get('agent/del',"IndexController@getAgentDel");       //代理成员删除
    Route::post('agent/add',"IndexController@postAddAgent");
    Route::get('agent/edit','IndexController@getAgentInfo');
    Route::post('agent/verify','IndexController@postVerify');    //审核代理

    // 系统公告列表
    Route::get('announceag',"AnnounceAgController@getIndex");
    // 代理商公告列表
    Route::get('announce/agent',"AnnounceAgController@getAnnounce");
    Route::post('announce/agent/del',"AnnounceAgController@postAnnounceDel");    //删除代理公告
    // 发布代理商公告
    Route::post('announceag/add',"AnnounceAgController@postAdd");
    Route::get('announceag/add',"AnnounceAgController@getAdd");

    // 修改代理商公告
    Route::post('announceag/edit',"AnnounceAgController@editAnnounce");

    // 查看订单列表
    Route::get('order',"OrderController@getOrderList");             //订单管理
    Route::get('order/detail',"OrderController@getOrderDetail");    //订单详情

    // 修改订单状态
    Route::get('order/change',"OrderController@getChangeState");
    //
    Route::post('order/send',"OrderController@postSendGoods");
    Route::get('order/info',"OrderController@getOrderInfo");

    // 获取防伪码列表
    Route::get('securitycode/in',"SecuritycodeController@getSecurityCodeList");
    Route::get('securitycode/out',"SecuritycodeController@getSecurityCodeOut");
    // 生成防伪码
    Route::get('securitycode/bulid',"SecuritycodeController@getCreateSecuritycode");

    // 保存防伪码
    Route::post("securitycode/add","SecuritycodeController@postAddSecurityCode");

    //分类管理
    Route::get('category',"CategoryController@getIndex");            //分类列表
    Route::get('category/add',"CategoryController@getAdd");          //添加分类页面
    Route::post('category/add',"CategoryController@postAdd");        //添加分类
    Route::get('category/edit',"CategoryController@getEdit");        //编辑分类
    Route::post('category/edit',"CategoryController@postEdit");      //编辑分类
    Route::post('category/change',"CategoryController@postChange");  //改变显示状态
    Route::get('category/del',"CategoryController@getDel");          //删除


    //导出Excel
    Route::get('excel/export','ExcelController@export');
    Route::get('excel/import','ExcelController@import');
    Route::get('brand/agent/excel','IndexController@getExcel');

    //数据备份还原
    Route::get('database/index/{type}','DatabaseController@getIndex');
    Route::any('database/optimize','DatabaseController@anyOptimize');
    Route::any('database/repair','DatabaseController@anyRepair');
    Route::get('database/del/{time?}','DatabaseController@getDel');
    Route::get('database/export','DatabaseController@getExport');
    Route::post('database/export','DatabaseController@postExport');
    Route::get('database/import','DatabaseController@getImport');
});


